package com.anbow.courseware.service.impl;

import com.anbow.courseware.entity.DO.User;
import com.anbow.courseware.entity.DTO.UserDTO;
import com.anbow.courseware.mapper.UserMapper;
import com.anbow.courseware.service.UserService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author zhaoYuFei
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User login(UserDTO user) {
        User result = new User();
        BeanUtils.copyProperties(user, result);
        return userMapper.login(result);
    }
}
